/*
 * @Author       : liumour @3d3-Studio
 * @Date         : 2021-02-04 21:16:03
 * @LastEditTime : 2021-03-02 22:37:49
 * @----------------------------------
 * @FilePath     : \Pro_Ui\src\wrappers\auth.js
 * @Description  : 
 */
import { Redirect, connect } from 'umi';

const PageView = (props) => {
  const { table: tb } = props;
  const user = tb.user;
  if (JSON.stringify(user)!=='{}') {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/login" />;
  }
};

export default connect(({ table }) => ({ table }))(PageView);
